package de.mhu.mandalaui.menu;

import de.mhu.mandalaui.AbstractComposite;
import de.mhu.mandalaui.Response;

public class Menu extends AbstractComposite<MenuItem, Object>{

	public void add(MenuItem item) {
		add(item, null);
	}
	
	@Override
	public void render(Response response) {
		response.startTag("ul", "dropdown-menu", this, "role", "menu");
		for (Container<MenuItem, Object> item : this) {
			response.containerEnter(item.getItem());
			item.getItem().render(response);
			response.containerLeave();
		}

		response.endTag("ul");
	}

}
